package com.rogan.rpc.rpcserver;

import java.io.IOException;

import com.rogan.rpc.DemoService;
import com.rogan.rpc.DemoServiceImpl;

public class RpcBootstrap {

	public void start(){
		RpcServer server = new RpcServer();
		try {
			
			ServiceRegister serviceRegister = new DefaultServiceRegister();
			ServiceObject so = new ServiceObject();
			so.setName(DemoService.class.getName());
			so.setInterf(DemoService.class);
			so.setObj(new DemoServiceImpl());
			serviceRegister.register(so );
			server.setServiceRegister(serviceRegister );
			server.start();
		} catch (ClassNotFoundException | IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
